package com.yyaccp.jdbc.util;

import java.io.IOException;
import java.io.InputStream;
import java.util.Properties;

public class ConfigManager {
    private static ConfigManager instance = new ConfigManager();
    private Properties props;
    private ConfigManager() {
        init();
    }
    private void init() {
        props = new Properties();
        try (InputStream in = getClass().getResourceAsStream("/jdbc.properties")) {
            props.load(in);
        } catch (IOException e) {
            e.printStackTrace();
        }
    }
    public static ConfigManager getInstance() {
        return instance;
    }

    public String getValue(String key) {
        return props.getProperty(key);
    }
}
